import { Tools } from 'weaver-mobile';

export const getAddAgentInfo = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/getAddAgentInfo',
        method: 'POST',
        params,
    });
};
export const getAgentDatas = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/getList',
        method: 'POST',
        params,
    });
};
export const getSearchCondition = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/getSearchCondition',
        method: 'POST',
        params,
    });
};
export const getAgentDetail = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/getAgentDetail',
        method: 'POST',
        params,
    });
};


//保存新建代理
export const addAgentSave = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/addAgentSave',
        method: 'POST',
        params,
    });
};

//存为模板
export const saveAgentTemplate = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/saveAgentTemplate',
        method: 'POST',
        params,
    });
};
//编辑代理的保存
export const saveAgentDetail = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/saveAgentDetail',
        method: 'POST',
        params,
    });
};


//删除模板
export const deleteTemplate = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/deleteAgentTemplate',
        method: 'POST',
        params,
    });
};


//获取模板
export const agentTemplate = (params) => {
    return Tools.callApi({
        url: '/api/public/browser/data/agentTemplate',
        method: 'GET',
        params: {
            min: 1,
            max: 10,
            pageSize: 10,
            ismobile: 1,
            ...params,
        }
    });
};


//收回代理
export const tackBackAgent = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/takeBackAgent',
        method: 'POST',
        params,
    });
};
//收回代理
export const takeBackPromptMsg = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/takeBackPromptMsg',
        method: 'POST',
        params,
    });
};


//批量编辑代理
export const getBatchEditInfo = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/getBatchEditInfo',
        method: 'POST',
        params,
    });
};

//批量编辑代理的保存
export const verifyAgentOverlap = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/verifyAgentOverlap',
        method: 'POST',
        params,
    });
};

//批量编辑代理的保存
export const saveBatchEditInfo = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/saveBatchEditInfo',
        method: 'POST',
        params,
    });
};
//批量收回代理
export const takeBackAgent = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/takeBackAgent',
        method: 'POST',
        params,
    });
};


//模板管理
export const agentTemplateList = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/agentTemplateList',
        method: 'POST',
        params,
    });
};

//模板管理高级搜索
export const agentTemplateCondition = params => {
    return Tools.callApi({
        url: '/api/workflow/agent/agentTemplateCondition',
        method: 'POST',
        params,
    });
};



